package com.ponhu.ea2.stockcenter.provider.constants;

public class CommonConstant {

    /**
     * 巨沃数据源标识
     */
    public static final String GWALL_DB = "gwalldb";

    public static final String IDEMPOTENCE_PREFIX = "IDEMPOTENCE";
    public static final String IDEMPOTENCE_UUID = "36b3b616aec7457ba3d2ab260cbbaf82";
    public static final String IDEMPOTENCE_SEMAPHORE = "IDEMPOTENCE_SEMAPHORE";

    public static final int IDEMPOTENCE_EXPIRED_SECONDS = 60;
    public static final int IDEMPOTENCE_EXPIRED_SECONDS_INIT = 3600;

    // SET WITHOUT_REDIS_LOCK true EX 36000 NX
    public static final String WITHOUT_REDIS_LOCK = "WITHOUT_REDIS_LOCK";

    public static final int ZERO = 0;

    // 库存变动时发生MQ消息状态
    public static final int SEND_MQ_STATUS_0 = 0;
    public static final int SEND_MQ_STATUS_1 = 1;
    public static final int SEND_MQ_STATUS_2 = 2;

    // 库存变动时发生MQ相关缓存常量
    public static final String MQ_SALESTOCK_CODE_EXP = "MQ_SALESTOCK_CODE_EXP";
    public static final String MQ_SALESTOCK_CODE = "MQ_SALESTOCK_CODE";
    public static final String MQ_SALESTOCK_MAP = "MQ_SALESTOCK_MAP";

    // 销售库存变动时发生MQ相关队列
    public static final String SALE_STOCK_TOPIC_EXCHANGE = "stock.topic.exchange"; // 主题交换机
    public static final String XCX_ROUTINGKEY = "ph.stock.data"; // 小程序路由键
    public static final String XCX_QUEUE = "stock.data"; // 小程序队列
    public static final String TB_ROUTINGKEY = "taobao.stock.data"; // 小程序路由键
    public static final String TB_QUEUE = "stock.taobao"; // 淘宝天猫奢品

    /**
     * 库存查询与更新 redisson读写锁(全局)
     */
    public static final String REDISSON_RW_LOCK_STOCK_GLOBAL = "REDISSON_RW_LOCK_STOCK_GLOBAL";

    /**
     * 对接WMS系统事件处理异常的货品编码集合
     */
    public static final String WMS_EVENT_HANDLER_ERROR = "WMS_EVENT_HANDLER_ERROR";

    /**
     * 对接WMS系统出库事件处理异常的缓存数据集合
     */
    public static final String WMS_OUT_EVENT_HANDLER_ERROR = "WMS_OUT_EVENT_HANDLER_ERROR";

    /**
     * 库存查询与更新 redisson读写锁(只针对实物层库存)
     */
    public static final String REDISSON_RW_LOCK_STOCK_REALITY = "REDISSON_RW_LOCK_STOCK_REALITY";

    // 关闭任务链和记录任务链互斥锁
    public static final String REDISSON_RW_LOCK_TRACE_UPD = "REDISSON_RW_LOCK_TRACE_UPD";
    // 关闭任务链缓存标记
    public static final String REDISSON_RW_LOCK_TRACE_DONE = "REDISSON_RW_LOCK_TRACE_DONE";

    public static final String WAREHOUSE_CHANGE_SETTINGS = "WAREHOUSE_CHANGE_SETTINGS";

    public static final String INVENTORY_CHANGE_SETTINGS = "INVENTORY_CHANGE_SETTINGS";

    public static final String GET_ALL_INVENTORY_STOCKS = "GET_ALL_INVENTORY_STOCKS";

    /**
     * 初始化状态
     */
    public interface INIT_STATUS {
        int UNFINISHED = 0;
        int FINISHED = 1;
    }

    /**
     * 采退单完完结状态
     */
    public interface PURCHASE_STATUS {
        int UNFINISHED = 0;
        int FINISHED = 1;
        int CLOSED = 2;
    }

    public interface YES_OR_NO {
        boolean YES = true;
        boolean NO = false;
    }

    public interface SUCCESS_OR_FAIL {
        int SUCCESS = 1;
        int FAIL = 2;
    }

    /**
     * 响应对接系统事件的渠道
     */
    public interface RECORD_CHANNEL {
        int OMS = 1;//OMS系统
        int WMS = 2;//WMS系统-任务中心
        int PURCHASE = 3;//采购中心
    }

    /**
     * 单据占用状态
     */
    public interface DOC_OCCUPY_STATUS {
        int PLACED = 1;//已下单
        int OUTED = 2;//已出库
        int CANCELED = 3;//已取消
    }

    /**
     * 销售层-单据调拨状态
     */
    public interface DOC_TRANSFER_STATUS {
        int NO_TRANSFER_APPLY_AND_NO_OUT = 1;//未调拨申请并且未出可售仓
        int TRANSFER_APPLIED_AND_NO_OUT = 2;//调拨已申请并且未出可售仓
        int TRANSFER_APPLIED_AND_OUTED = 3;//调拨已申请并且已出可售仓
    }

    /**
     * 库存中心响应事件的处理逻辑
     */
    public interface STOCK_ACTION_RESPONSE {
        int NO = 0;
        int PLUS = 1;//实物+
        int SUBTRACT = 2;//实物-
        int REAL_PLUS_AND_UNREAL_SUBTRACT = 3;//实物+，虚拟-
        int REAL_SUBTRACT_AND_UNREAL_PLUS = 4;//实物-，虚拟+
    }

    /**
     * 商品货品类型
     */
    public interface GOODS_TYPE {
        int REAL = 1;//实物类
        int UNREAL = 2;//虚拟类
    }

}
